<template>
    <div class="dashboard-editor-container">
        <panel-group @handleSetLineChartData="handleSetLineChartData" :data="data"/>
        <!-- 数据加载完毕之后，自动展示 -->
        <h2 :style="server_data.php_os ? 'display:block' : 'display:none'"> 服务器状态信息 </h2>


    </div>
</template>

<script>
    import {statistics, versionLogs, getServerStatus} from "@/api/indexs";

    const lineChartData = {

    };

    export default {
        name: 'DashboardAdmin',
        components: {

        },
        // 监听
        watch: {

        },
        data() {
            return {
                lineChartData: lineChartData.newVisitis,
                skill:[], // 技能组
                data:{},
                version_logs: [], // 版本记录
                server_data: {}, // 服务器状态信息
            }
        },
        created() {

        },
        methods: {

            // 定时：服务器状态信息
            timedRequestServerStatus(){
                // 定时多少秒触发一次：默认60秒【服务器状态信息】
                window.setInterval(() => {
                    setTimeout(this.getServerStatus, 0);
                }, 1000 * 60);
            },
            handleSetLineChartData(type) {
                this.lineChartData = lineChartData[type];
            },
        }
    }
</script>

<style lang="scss" scoped>
    .dashboard-editor-container {
        padding: 32px;
        background-color: rgb(240, 242, 245);
        position: relative;

        .el-row{
            margin-bottom:30px;
        }

        .github-corner {
            position: absolute;
            top: 0px;
            border: 0;
            right: 0;
        }

        .chart-wrapper {
            background: #fff;
            padding: 16px 16px 0;
            margin-bottom: 32px;
        }

        .chart-container{
            position: relative;
            width: 100%;
            height: calc(100vh - 100px);
        }
    }

    @media (max-width: 1024px) {
        .chart-wrapper {
            padding: 8px;
        }
    }
</style>
